package cn.yunhe.services;

import cn.yunhe.dao.ISearchHouseDao;
import cn.yunhe.entity.House;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class SearchHouseService {
    SqlSession session = null;
    ISearchHouseDao iSearchHouseDao = null;

    /**
     * 查询房屋
     * @param house
     * @return
     */
    public List<House> searchHouse(House house) {
        List<House> houseList = null;
        try {
            session = SqlSessionFactoryUtil.getSqlSession();
            iSearchHouseDao = session.getMapper(ISearchHouseDao.class);
            houseList = iSearchHouseDao.searchHouse(house);
        } finally {
            session.close();
        }
        return houseList;
    }

}
